import {AUTH_TOKEN} from "./auth.service.js";

class TokenService {
    getUser() {
        const user = JSON.parse(localStorage.getItem("user"))
        return user
    }
    getToken() {
        const user = JSON.parse(localStorage.getItem("user"))
        return user?.access_token
    }

    getRefreshToken() {
        const user = JSON.parse(localStorage.getItem("user"))
        return user?.refresh_token
    }

    setUser(payload) {
        window.localStorage.setItem("user", JSON.stringify(payload))
    }
}

export default new TokenService()